import { UnityEngine } from "csharp";
import { $typeof } from "puerts";

let cube = UnityEngine.GameObject.Find("Cube");
let btn = UnityEngine.GameObject.Find("Button1");
let btnComponent = btn.GetComponent($typeof(UnityEngine.UI.Button)) as UnityEngine.UI.Button;

btnComponent.onClick.AddListener(
    ()=>{
        cube.transform.Rotate(10,0,0);
    }
)
let callback = function func1(){
    cube.transform.localScale = UnityEngine.Vector3.op_Addition(cube.transform.localScale,new UnityEngine.Vector3(0.1,0.1,0.1));
}
btnComponent.onClick.AddListener(callback);

// btnComponent.onClick.RemoveListener(callback);
// btnComponent.onClick.RemoveAllListeners();